/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cip.esymons.eventos.bc;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.eventos.be.NumeraContratos;

/**
 *
 * @author Lizardo Rios
 */
public class NumeraContratosDelegate {

    NumeraContratosFacadeLocal local;

    public NumeraContratosDelegate() {
        local = lookupNumeraContratosFacade();
    }

    public void create(NumeraContratos numeracion) throws Exception {
        local.create(numeracion);
    }

    public void edit(NumeraContratos numeracion) throws Exception {
        local.edit(numeracion);
    }

    public void remove(NumeraContratos numeracion) throws Exception {
        local.remove(numeracion);
    }

    public NumeraContratos find(Object id) throws Exception {
        return local.find(id);
    }

    public List<NumeraContratos> findAll() throws Exception {
        return local.findAll();
    }

    private NumeraContratosFacadeLocal lookupNumeraContratosFacade() {
        try {
            Context c = new InitialContext();
            return (NumeraContratosFacadeLocal) c.lookup("java:comp/env/NumeraContratosFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }



}
